The Firewall and Trojans on the Computer

Okay; I have another question. When a trojan gets through onto your computer via drive-by download, what role does the firewall play in protecting you, and how much of a role does it play? It was my understanding that if a trojan on the computer tried to access the internet or communicate with an attacker, that the firewall would block it. But I got the impression later on that the firewall might not be as much of a help at that point. Is that true? Thanks.