A similar post in the python NG turned out this tutorial.

The BSD sockets API is exposed in perl/python/ruby. If you're familiar with any of these, a few throw-away experimental scripts might help you gain a quick understanding of the API.

The C-level API requires a lot of casting if I recall correctly. The thing that really (once) helped me understand it all is that the BSD library was designed as a multi-protocol one, not just tcpip. So the structure which represents a generic network address is slightly expanded to accomodate the notion of a tcp address, and when passing pointers to these, one needs to explicitly cast in C. In C++ proper objects can represent those notions and offer a cleaner interface. You can implement such a wrapper yourself once you've understood the underlying C-level API.