I had to write up an internal article on creating custom service applications and making it work with SharePoint 2010.  This was not an easy joke at all and is pretty involved process.  I used the sample walk-through provided in Service Application Framework Sample.  This would a very good reference if you want to learn the components of a service application and the classes/methods that needs to be implemented.  Specifically, it gives a good idea on the overall service application architecture.  However, the sample requires some tweaking to get it to work.  I’ve attached a copy of the sample I wrote, which is based on this article.

Use the text file “Service Application Notes.txt” file to see how to install this custom service application and test it.  There’s a sample walk-through by Tony on building a service application application that provide auto-complete functionality.  I found this to be very useful especially since he explains the components in detailed and walks us through building a custom service application.