You
could use Webcam Plus (
http://www.ateksoft.com/webcamplus.html), which does just that - uses your phone as a webcam for your computer. But.... the app is kinda funky. It runs incredibly s..l...o...w.. when changing settings, and when you close it, it doesn't really close. Give it a try if you want, you can always uninstall it.
As far as using the phone as a general webcam (not specifically for a computer), there are a few other threads listing many more programs.