C-sample-chat-application is a project mainly written in C++, it's free.
Client-server programs providing line-by-line chat
This is a demonstration of a client-server connection. It generates two executables. Start the server, then connect to it with the client to enable a line-by-line chat session. Not much to see here, but it's a small demonstration of how to use sockets.