Assuming USB 2.0 full or high speed, the host (actually the upstream hub) detects device attachment by detecting the voltage at the pull-up resistor on D+.
So the pull-up should be switched out until the device is ready to begin communicating.
Except for some devices with weak or dead batteries, the device must bring the pull-up line high within 1 s after detecting that VBUS is at least 0.8 V.