Apple recently released an excellent sample called BasicInputMethod
<a href="http://developer.apple.com/samplecode/Sample_Code/Interapplication_Comm/BasicInputMethod.htm" target="_blank">BasicInputMethod</a>
It also has input window etc. I think most things in the Inside Macintosh: Text is still valid for input methods.
Good luck