There are basically two different types of webservices, one that is SOAP-based and the other is REST-based.
Either can be accessed by desktop applications. I have written applications, such as screensavers, that will interact with the server through both of these types of webservices.
An API is useful so that people can write applications, as you mentioned, to use these services, as, without applications using them, these webservices are pretty useless.
A SOAP-based webservice is basically just a web application that sends and receives using an xml message format that follows a standard.
A REST-based webservice is the cgi-based application that is similar to using an html form element, generally using GET, but, if you are doing anything that can be destructive, or change databases, you will want to use POST.
You can write applications using these APIs in any language, which is the advantage, as you can then choose which language is best for the server-side, and that has no impact on what you do on the client-side.
How to create a webservice will depend on which of the two main types you want to create, and which language you choose to use.