The culprit turned out to be an IE8 plugin installed by Norton Internet Security 2010. Here is how I found the problem:
1. I recorded a macro of me correctly typing "The quick brown fox jumped over the lazy dog." - this ensured that any errors made were not made by me.
2. I ran the macro in the gmail compose window and let it loop 50 times continuously - this allowed me to see that random characters were not registering.
3. After doing some google searching and finding others with this same problem, I found out that calling IE8 from a command prompt disables most plugins. When I ran IE8 in this manner, all keypresses registered correctly.
4. I then ran IE8 with all plugins enabled and then started disabling them 1 by 1, running the macro after disabling each plugin. Eventually I found out that the culprit was the Symantec NCO BHO plugin.
The NCO BHO plugin basically analyzes the results returned by search engines and displays an icon next to them indicating if the site is safe or contains a trojan, virus, etc. For now I have disabled the feature, but it would be nice if Symantec could fix it since I've already paid for NIS 2010.
Now that I think about it, I did start noticing the dropped keypresses problem right around the time I upgraded from NIS 2009 to 2010, but with as many changes as I make to my PC, it would have been impossible for me to have made the connection at that time.