For this we need to install USB WebCam software from placaware on android phone. This is available on android market.
Corresponding windows PC host application software need to be installed on your windows box. This software is available for free download here.
Apart from above 2 softwares you need to install ADB driver from google for making your phone recognized by windows. By default it shows it as mass storage device, if u want your pc to recognize it as android device we need adb drivers. For this you need to install android SDK. Step by step procedure for the same can be found in my previous post on android development setup.
Once you have the SDK installed on your system , follow the instructions given in Adding SDK Components to launch the Android SDK and AVD Manager. From the Available Packages panel, select "Usb Driver Package" and download it to your computer. The driver files are downloaded into the
After instaling this driver you will see Android Phone Device listed under your Device Manager(i.e. System Properties->Device Manager->Android Phone).
Now we are ready to use our phone as webcam of the desktop or laptop. For this we need to connect phone via USB cable. Run USB WebCam program on your phone as well as computer. Lauch skype or yahoo messenger and your phone will be detected as webcam.
I tried it and it is awesome, can use my HTC wildfire's 5 megapixel cam on my laptop with most of the video chat applications.