The main problem with both the P-40 and the Typhoon is that they had terrible performance at high altitude. All German Me-109 and Fw-190 marks easily outperformed them at altitude. Most combat in NW Europe took place at high altitude, because Allied heavy bombers flew at high altitude. Thus, as fighters, both planes are equal failures. In North Africa, where most (but not all) bombing missions were lower altitude ground support missions, the poor high altitude performance of the P-40 and Typhoon was not as relevant. The P-40 (Kittyhawk) gave a decent account of itself in North Africa. It could hold its own against 109's at low altitude.
With thousands of P-40's and Typhoons built, something had to be done with them other than high altitude combat, which they were really bad at. Thus, attempts were made to convert them to ground attack planes. The Typhoon, with its heavy wing construction, excelled at this. It could carry a bomb/rocket load that the P-40 couldn't match. It was also very fast at sea level. In fact, no Allied or German plane could catch it down low. It was the only plane that could intercept the German V-1 rockets.
Where the P-40 excelled was against Japan. Japanese planes, with with their Low Wing Loading, which gave unparalleled maneuverability at low to mid altitudes, also mitigated against it at higher altitudes. The P-40 (as well as every US Fighter), had a more powerful engine and a heavier, stronger air-frame. This gave them, respectively, a higher service ceiling and superior dive performance. This enable the "dive and swoop" tactics that the Japanese were never able to counter throughout the war. These tactics were developed by General Chenault and the Flying Tigers. Thus, their fantastic victory to loss rate. The P-40 would use its higher service ceiling to gain an altitude advantage. They would then swoop down on their opponent in a single firing pass, and then use the momentum of the dive to regain altitude. The Japanese couldn't out dive them, and because their Low Wing Loading gave them inferior high altitude maneuverability, they couldn't out turn the P-40 in its dive either. As long as the P-40 (and all US fighters) did not get caught at low altitude or in a turning dog-fight, they would usually win.
Remember, there are always engineering trade-offs when designing an airplane. The Laws of Physics tell us that the factors that make a plane maneuverable at low altitude will make it less maneuverable at high altitude. An engine optimized for low level performance will mitigate against it at higher altitudes. There are also speed vs maneuverability trade-offs as well as range vs weight trade-offs. An aircraft designer can either design an all-purpose plane that does many things average-ish, but does not excel at anything (P-51), or he can design a plane optimized for a specific role (F-6 Hellcat). It all depends on what the end-user tells the designer what it wants. The military try to envision future wars and a plane's role in that war. They will then give specifications to the designer as to what they want the plane to do, and the designer will make it. This is a long process, so if the military get their initial specifications wrong, it will take years to correct. The F-4 Phantom is an example of a plane that was used in a role that the military hadn't anticipated, dog-fighting with lighter, more maneuverable fighters, rather than being a stand-off, air-to-air missile platform. It took years to overcome this screw-up, and to develop the F-15 and F-16 to overcome it. An example of a purpose built plane done right is the Spitfire. The RAF envisioned a certain role for the plane and the designers build it exactly for this role. The RAF correctly foresaw the Battle of Britain and built a fighter to fit this exact scenario, a short-range, high-speed, high-altitude point defense fighter for use over Southern England. The Spitfire was designed and optimized for this specific role. Thus, it excelled. It was not as successful in other roles, such as bomber escort, where it was handicapped by its poor range.
So, the short answer to the question is: in NW Europe, both the P-40 and Typhoon were equally bad. However the Typhoon became an excellent ground support plane in ways that the P-40 could not match. In the Pacific, the P-40 was an effective fighter, so long as it used the right tactics. The Typhoons were never tested in the Pacific.