To do this you can use the WSDL.exe which can be found inside the Visual studio folders (in my case here:
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\wsdl.exe")
Microsoft link: link
If you on the other hand wants to use some classes described in an XML-file, you should instead use xsd.exe
C:\projects\ebXML>xsd.exe rim.xsd /classes
that will autogenerate .NET c# classes for each element in the xsd.