Can you explain the requirement more please Ian? I'm not sure it's possible, but some devices might reverse through a mechanical switch
USB usually expects one end of the link to be a host and the other end to be a client. The client can be a hub fanning out to support multiple clients. Some devices can be a hosts and clients.
USB is a network technology, not just wires. Devices communicate what sort of device they are and each has a unique address. Usually both ends of the link are intelligent.
Here's what my computer has plugged in at the moment:

The client / host relationship is embedded in a protocol which won't work unless the two ends understand each other. Connecting a USB mouse to an MP3 Player has no effect because they are both clients and can't communicate. However, by plugging them into a hub the mouse and MP3 player can both talk to the computer over a single cable, allowing the mouse to point and click on an application that downloads music on to the MP3 player.
Note the computer knows what hubs it has and has identified exactly what each plugged in device is so that it can be connected to the right device driver. Device 009 is a Unifying Receiver, which is a USB dongle supporting both mouse and keyboard. Device 014 is an MP3 player, and there are two different Bluetooth transceivers. Devices appear and disappear as the cable is plugged in or out, and they can have wildly different capabilities – Cameras, audio, video, ethernet adaptors, Arduinos, printers, plotters, etc.
Device recognition would be a problem for a switch sharing two devices with one computer . Throwing the switch would disconnect one device, causing the host to kill whatever program was using it, and instantiate the other, setting it up for another program to use it, but not starting anything unless the programmer is clever. Switching is all allowed – no different from pulling the cable out of one device and plugging it into another, but it's a hard reset in both directions. Is that what's wanted?
Dave