I googled it:
4. Flight connection from an International flight to the United States: If your flight originated outside of Canada or the U.S. and you need to connect to a US destination, you have two options depending on whether your airline automatically transfers your baggage or not: (a) if it does, and you have a boarding pass to your connecting flight, proceed via a connecting flights corridor (avoiding Canadian Customs), go through US Customs and your checked baggage will be automatically transferred (US Customs, at their discretion, can recall your baggage for manual inspection). (b) if the airline does not offer auto transfer of your baggage, you have to pick it up from the carousel & follow first normal international arrivals procedures, then U.S. ones.
US customs is pretty quick. They usually call out flight numbers and prioritize the line when it gets close.