To add to the earlier answer, look at
Building a Simple Word Processor Around an Extended RichTextBox Control[
^]
You could use the techniques in that and just add your keyboard.
If you're looking for a virtual keyboard that you can use with any program, I suggest this thread:
Virtual Keyboard[
^]
Towards the end, one of the guys supplied code for a virtual keyboard program that works in notepad, word, whatever.