Depending on what your goals are you can write the socket code in C and wrap it in C++ classes, or you can use existing frameworks such as ACE (Adaptive Communication Environment).
More info on ACE can be found here:
http://www.cs.wustl.edu/~schmidt/ACE.html
ACE is strongly based on using design patterns and templates, very well implemented, and not so easy to use.