There are switching boxes and print sharing boxes out there. Switch boxes are just that. They have a switch to select which PC to connect to the printer. Print sharing boxes detect which device is trying to output and elecrically connect. You just need either of these and the appropriate cable. They have been around a long time. You will want to make sure that bi-directional capability is specified. These also have their quirks and, for the cost of cables and the box, you can probably network the two PCs for the same or less and avoid certain problems.
I work with a desktop and a laptop from home. Usually I don't hook up my laptop to my all-in-one, but I was wondering if it is possible to share the same printer with two computers that are not in a network.