Although "offshoring" is intimately linked with globalization, it is a relatively minor factor in the decline of the American Middle class. Service sector and other jobs such as in transportation, the prison industry, etc, have to a considerable extent offset the losses in manufacturing jobs.
Among the several factors that have resulted in the decline of the American Middle class, two of the most important are: 1) a severe reduction in income tax bracket progressiveness (part of the push into supply-side economics) in the 1980s -- nearly to the point of reaching a flat tax -- that has since been only partially restored; 2) the compounded effect of ~35 years of taxing unearned income at lower rates than earned. Note that these two factors are linked.
There are additional factors. See, for example: "Capital in the 21st Century", T. Piketty, and "Zombie Economics" J. Quiggin.