Oy vey, I just stumbled into this trap too.

Fortunately, the other top google hit was a recent apple support page.

http://support.apple.com/kb/TS3104

The trick to fix it (worked for me) is not to close the keyboard viewer with the red close button (because, why would we ever do that?), rather, go back to the drop-down menu and select Hide Keyboard Viewer.

Mine was showing up every time I hit the "Back" button on my 5-button mouse. Made browsing sucktacular.