When you created your custom binding in code, did you also implement a "YourBindingElement" (deriving from StandardBindingElement) and a "YourBindingCollectionElement" (deriving from StandardBindingCollectionElement) along with it?
If so - use that to configure your custom binding, as if it were any other binding.
The first step is to register your binding in the app.config or web.config file in the extensions section of <system.serviceModel>
<extensions>
<bindingExtensions>
<add name="yourBindingName"
type="YourBinding.YourBindingCollectionElement, YourBindingAssembly" />
</bindingExtensions>
</extensions>
Now, your new binding is registered as a "normal" available binding in WCF. Specify your specifics in the bindings section as for other bindings, too:
<bindings>
<yourBinding>
<binding name="yourBindingConfig"
proxyAddress="...." useDefaultWebProxy="false" />
</yourBinding>
</bindings>
Specify other parameters here, as defined in your "...BindingElement" class.
Lastly, use your binding like a normal binding in your services and/or client sections in system.serviceModel:
<client>
<endpoint
address="....your url here......"
binding="yourBinding"
bindingConfiguration="yourBindingConfig"
contract="IYourContract"
name="YourClientEndpointName" />
</client>
I couldn't really find a lot of resources on how to write your own binding in code on the web - Microsoft has a WCF/WPF/WF sample kit which includes a few samples from which I basically learned enough to figure it out :-)
There's one really good article by Michele Leroux Bustamante on creating your custom bindings - part 2 of a series, but part 1 is not available publicly :-(
Here's a sample custom binding in code for which you can download the complete source code: ClearUserNameBinding.
Marc