You don't need a transit visa as long as you don't move out of the airport(in the UK not sure about the USA) given that you have a valid Canadian TRV or US visa!
You don't usually require a visa to transit from the UK provided that you have a valid Canadian TRV ( you need a visa for your arrival country) however you need a US transit visa if you want to transit from US. That usually costs $160 and an interview is also required.