Have u tried updating the DirectX on ur system?
U might be having the latest graphics and chipset drivers but old DirectX drivers will give u error.
U are on XP, right? XP will not have updated DirectX. It will have updations as on 2001 or 2002 and COD2 was after that.
So u'll need to update DirectX from Microsoft's website. and then it will work.
Doesn't matter whether it is pirated or genuine unless its a ripped version which has problems.
As far as i can see from ur post, COD4 worked on ur friend's system coz its a Dell which comes with DX and all pre-configured.
U can install COD4 demo on ur system. It should also update DX i guess. And then u can try COD2 and it should work.