Sorry for the late reply.
I did not physically detach and reattach.
The idea is to implement a bootloadable device via usb (without a programmer):
The device enumerates with a VID/PID as a measurement device. When its firmware needs to be upgraded, the host application sends a message to the device which "tells" the device to run a bootloader firmware, and at that stage the host should close the connection with the original VID/PID, and initiate a new connection with the bootloader with a new VID/PID in order to transfer the upgraded firmware.
At the end of the upgrade process, the device resets itself and boots as the measurement device (original VID/PID again). The host should again disconnect from the device (as a bootloader) and reconnect with the original VID/PID.
The whole process is done without touching the USB cable.