yES you need transit visa for USA, even if your flight to canada is on the same aircraft. Apply early. The US consulate will want to make sure that your Canadian documents are in order, that you are not a threat to miss the connection flight in order to stay illegally in the US.
IN addition, you will go through Canadian immigration in the USA itself, and not when you land in Canada.