Ya.....fopen() is right way to open port as file and then read and write through that handle.

One more important thing : you will have to use NULL MODEM CABLE to connect your two computers through COM port.