Here is an example LDIF file that adds an attribute to the schema. Replace "X", attributeID, attributeSyntax, schemaIDGUID and the others with values you need to have. Programmatically you might try to send this LDIF file using LDAP, or using ADAM's command line utility ldifde
(I hope I remember it's name correctly). I actually used this ldif file to import a new attribute into ADAM a few years ago...
dn: CN=Uid-Number,CN=Schema,CN=Configuration,CN=X
changetype: ntdsschemaadd
objectClass: top
objectClass: attributeSchema
cn: Uid-Number
attributeID: 1.2.840.113556.1.4.302.1.2.3.4.5.6.7
attributeSyntax: 2.5.5.9
isSingleValued: TRUE
rangeLower: 1
rangeUpper: 100000
showInAdvancedViewOnly: TRUE
adminDisplayName: Uid-Number
adminDescription: Uid-Number
instanceType: 4
oMSyntax: 2
searchFlags: 0
lDAPDisplayName: uidNumber
schemaIDGUID:: MnqWv+YM0BGihQCqADBJ4g==
systemOnly: FALSE
Don't forget that Active Directory only allows to add new schema entries, and you cannot delete them. I think this holds to ADAM too, so be careful when adding new entries.