V.R.C.C. (Video Remote Computer Camera) is a freeware and open source system that enables your smartphone to be used as a Webcam and lets you control the smartphone from the PC.

http://sourceforge.net/projects/vrcc/