The most likely culprit is mechanical - something's shaky with your wiring or connectors.
Check the USB cables as they go into the laptop - my guess is that either you're bumping them when fooling with the VGA cable, or the connector on the motherboard is marginal, leading to a disconnect when you fool with other connectors.
Is your VGA cable detachable from your monitor? If so, try disconnecting and connecting it at the monitor end and see what happens. My bet is that nothing happens, thus re-enforcing the idea that the problem is at the laptop end.
Once you figure out what connector/cable is really at fault, you'll have to find a way to deal with it - if it's a USB cable, that's usually easy to replace. If it's the motherboard connector, you've got a larger problem (though try adding a hub, and using a different motherboard USB connector.)