OpenLDAP provides an LDAP client library http://www.openldap.org/