Using Netcat as a chat program is easy, to try it just run the command on one of the machines with the -l option to listen on a port (port 12345 in this example):
nc -l 12345
And on the other machine connect to the first using its IP address or hostname and the port it is listening on by entering:
Once the connection is made type anything on one of the machines and press enter to display it on the other. And to close the connection press CTRL + D on any of them.