There are various softwares available on the net for this purpose. There are freeware as well as shareware versions of it.
One such software would be Mobiola WebCamera.
Still if you would like to develop a software on your own then you would have to use Java and C#.Net for your development.
If you are able to get the API for your Handset model then it would be easier for you. But if you are thinking of building/developing a software which can be used on any platform then it would involve Java..
If what i think you want to achieve is then i think that the below document would help you, The below document is the answer for your 2nd Question,