If you make the C++ program respond to an IP address visible to your machine, yes it's doable. Just connect to that address.
EDIT: er wait the program is on another machine? Screw that, you're basically asking for the most common server operation in existence. Just make sure there's an address to connect to and you're set.