Fastest way to level up in Modern Warfare 2 / Black Ops
Solution 1:
I would say avoid big games especially Ground War. It seems it's easier to get kills because there's more people but in fact it's a lot harder to get high kill streak because of bigger chance of getting killed.
Do learn the maps as fast as you can so you can easily pick good spots and avoid those from where you can get killed from easily. Watch killcams for that (as was suggested in the answer to another question).
Unlock challenges for the same gun to get optimal performance out of it. Almost every gun (at least from assault rifles) can be configured to be effective.
Lastly, try to play stealth to avoid many deaths and therefore build higher streaks. Use silencer, Ninja and Cold Blooded for that.
Solution 2:
I actually recommend playing Ground War, especially Domination. You can rack up some serious points will capturing the flag point and kills. A good strategy would be to spawn trap the opposing team. You can accomplish this by letting them hold one flag and they will spawn around that point. The AC-130 is great for spawn trapping.
Headquarters Pro is also another game type where you can rack up experience points. You get +10 for every 5 seconds you hold the HQ, but you do not respawn if you die during the time. You will have to wait until the other team destorys the HQ.
The last game type you can play is Search and Destory. You get serious experience points for kills and destorying the target. I personally do not like this game mode, I find it boring.
Solution 3:
A decent way to get easy points is setting up a SAM turret in Ground War. Just set it up somewhere and wait for it to shoot things down.