Boot order can change if you enable/disable an option named CMOS (or something like that) in BIOS. I can't remember exactly which mode does what but one of them let you manage boot devices manually and the other adds then once they're found. You may be using the second mode and thus when your printer is not connected the laptop boots from your hard drive but when it it connected it tries to boot from USB. In that case however you should see a text on the screen saying there's no boot able OS available.
Another thing could be the power, are both your laptop and printer plugged into individual AC power outlets or is the printer powered by USB? in the latter case, your laptop might not be able to send enough power on the USB port to power the printer causing the printer to hang and thus making the system hang.
Last but not least, does it work if you plug in the printer after boot into the OS?