I have no experience in IPv6 programming, perhaps this chapter will be filled by others or moved away to another HOWTO.
More Information can be found here:
RFC 2553 / Basic Socket Interface Extensions for IPv6
Draft / Advanced Sockets API for IPv6 / draft-ietf-ipngwg-rfc2292bis-XY.txt
Porting applications to IPv6 HowTo by Eva M. Castro