which may be difficult with a non-working keyboard but you can try.
Hold down the Command + Option + P + R keys at the first chime and keep them down until the second chime.
Uninstall VIrtualBox, if you can and see if it goes away.
Boot from the OS X installation disk and see if you have a working keyboard in that.
I use iMac with OSX 10.5.8 The keyboard will not work in any of my USB ports. I tried another keyboard and it would not work. I started in safe mode and still no keyboard. Applecare could not help. Can anyone?
I had downloaded VirtualBox but the keyboard was working for a while after that. It just stopped while I was chatting with a friend on Yahoo IM.