Open Visual Basic 6.0 and create a new Standard .exe file. Add a button to the form and double-click the button to add the following code to the Click handler:
monString = "service:mexAddress=http://localhost:8000/ServiceModelSamples/Service?wsdl"
monString = monString + ", address=http://localhost:8000/ServiceModelSamples/Service"
monString = monString + ", contract=ICalculator, contractNamespace=http://Microsoft.ServiceModel.Samples"
monString = monString + ", binding=BasicHttpBinding_ICalculator, bindingNamespace=http://Microsoft.ServiceModel.Samples"
Set monikerProxy = GetObject(monString)
'Set the Service Certificate.
monikerProxy.ChannelCredentials.SetServiceCertificateAuthentication "CurrentUser", "NoCheck", "PeerOrChainTrust"
monikerProxy.ChannelCredentials.SetDefaultServiceCertificateFromStore "CurrentUser", "TrustedPeople", "FindBySubjectName", "localhost"
'Set the Client Certificate.
monikerProxy.ChannelCredentials.SetClientCertificateFromStoreByName "CN=client.com", "CurrentUser", "My"
MsgBox monikerProxy.Add(3, 4)