I don't know of a specific library but my favorite virtual keyboard came with Frodo (C64 emulator) and all the source code is available from the author:
do you need a real keyboard umulation or... just "input text" thing?
if it's the 2nd then go to www.famesoft.ru
and get the sources of "CoMi - Compact File Manager"
you can use any piece of its code for yourself