Richelieu, the INS have a pre-clearance facility at YYZ for US bound flights. You clear both immigration and customs before boarding the plane, thus allowing the flights to use domestic gates on arrival in the US. It is a good facility for avoiding the sometimes horrific immigration queues at somewhere like ORD, though YYZ facility has a well deserved reputiation for being staffed by some nasty people.
DUB has a pre-clearance facility too, as do some Carribbean islands.