How can I plug an arbitrary USB device into two computers?
You are missing the fact that USB is bidirectional serial protocol, and having two USB hosts talking to a single USB device is not supported neither on physical neither on logical level of the protocol.
What you can do is to make each key of the keyboard connected to two MCUs each capable of beeing USB HID, and have their USB cables connected to two PCs. You can use two cheap AVR MCUs for this and use USB HID software implementation, just make two identical HIDkeys and connect each key to both. Btw, read the license carefully.