Here is the way to create xsd file from xml using XSD in VS.Net 2005
For this we need to put our xml file in to c:\Program Files\Microsoft Visual Studio 8\VC and run the following command in visual studio command prompt.
xsd test.xml // here test.xml is our xml file.
The following command for creating a CSharp class from xsd.
xsd test.xsd /c