How to construct a switch that would switch between two USB outputs, controlled electrically?
I have worked with a USB switch, and it's not as simple as it first seems. My first job at a new company was to debug why some of their USB switches were failing. The switch involved a 4 pole changeover, as you're describing. The symptom was that the PC froze about one in 10 switch events, on some of the switches. The switches appeared electrically identical, as did the switching events. The breakthrough came when we switched from XP to win7, and the failure ratio changed, was it a detailed timing interaction with the drivers?

USB is designed for human connection and disconnection, which means slow, and the software drivers tend to have been written making this assumption. The connectors are designed with long and short pins so that power goes on first and off last.

Rather than whipping all four pins from one device to another, something the driver will not have been designed or tested for, you are much more likely to get success if you use discrete 2-pole relays to perform a simulation of the human disconnect-connect sequence. In four separate steps, break data then break power to the old device, wait for a few seconds, then make power then make data on the new device.

In retrospect, what was surprising about the 4 pole switch was that it worked as often as it did. It worked well enough to lull everyone into a false sense of security.