The US has the largest gross trade deficit with China. But some economists have argued that this is misleading, e.g. using the iPhone as an example in which most parts don't orginate in China.
There's actually a more academic version of this analysis called "trade in value-added", which can be roughly summarized as:
Global imbalances: accounting for trade in value-added (specifically accounting for trade in intermediate parts and components) and taking into account “trade in tasks” does not change the overall trade balance of a country with the rest of the world – it redistributes the surpluses and deficits across partner countries. When bilateral trade balances are measured in gross terms, the deficit with final goods producers (or the surplus of exporters of final products) is exaggerated because it incorporates the value of foreign inputs. The underlying imbalance is in fact with the countries that supplied inputs to the final producer. As pressure for rebalancing increases in the context of persistent deficits, there is a risk of protectionist responses that target countries at the end of global value chains on the basis of an inaccurate perception of the origin of trade imbalances.
This does look like quite an involved method to follow for all imports though. My question for here is: with whom would the US have the largest trade imbalance if one uses the "trade in value-added" (possibly recursively) to track US imports to their components?