Given two domains - Domain1 and Domain2 you want to add Domain1 as a trusting (permitted to trust) domain on Domain2.
Domain2 is either the domain where the sample script will run or is a trusted domain of the current domain.
Use the AddTrustingDomain method of IDomainTrustManagement interface to add Domain1 as a trusting domain on Domain2.
Dim Trust As
Dim Password As String
'Get the interface.
Set Trust = GetObject ("NTDS://Domain2")
Password = InputBox ("Enter the password used while adding trusted domain", "")
'Add domain1 as trusting domain of Domain2
Trust.AddTrustingDomain "Domain1", Password