Internet MIDI is a Mac/PC application from TimeWarp Technologies that connects any two MIDI instruments together over the Internet. You can find it here:
timewarptech.com/internet-midi
The software is robust and works over a peer-to-peer Internet connection. It can handle nearly every MIDI message and up to 16 channels of data.
In theory, you can use Internet MIDI to play duets. The reality of the Internet is that there can be substantial jitter which results in some MIDI messages arriving late. The application has a user-adjustable buffer so that you can add a delay to the incoming MIDI data and thus preserve the integrity of the performance. Of course, if your objective is to do a duet that is rigorously in time, you want to minimize the buffering.
Bottom line: Internet MIDI is a great program (as stated by me, the President of the company). However, if your objective is a real-time duet, your success is directly related to the latencies of your local area network, your partner's local area network, and the Internet gateways in between.