If the device is bus powered (i.e. Vcc/Vdd derived from Vusb), you can just connect the 1.5KOhm pull up to Vcc/Vdd (when Vusb goes away, the pull up goes away).
If, instead it's self powered, you need to sense the Vusb, a transistor and some resistors will nicely do.