Device to share power between service panels
I don't see any practical way, and by that I mean cost effective and in a manner that both sides would be satisfied with the result. See Ed Beal's comment.
You could set up a transfer switch (a double pole double throw switch with a neutral position). The common poles would connect to the appliance and each side of the switch would connect to opposing panels including breaking the neutral. Then whom ever would want to use the appliance would have to be able to switch to his panel. When they were finished the circuit would have to be reset to the neutral position automatically. To keep one person from using the other persons power you would have to set up some sort of interlock where one side could only turn on their power and not the other. It is also important to note that no one really manufacturers this sort of device so control would be a one off set of parts.
In most multi-residential buildings you have shared appliances on a House Panel which serves a common area and the utility charge is divided up and billed as part of the rent.
Hope this helps.