first important step is to set up a server application with handles each connection on its own thread
you should have a client(as many as you need) and a single server
use winsock
inside the server
set up a listening socket, and a connection socket.
make that listening socket loop forever, and when it gets a connection send it to the connection socket on its own thread
after that, on the same thread(new one), make it so that all it does is take in packets from a connection and distribute it to other connected clients.
on the client side just make it connect to the server, send in packets and let the server do it's job, + let the server connect to you so you receive other messages
3 clients, 1 client sends message to server, server distributes a clone of the message to all the other clients and deletes it afterwards
app should no doubt be multi-threaded