Inside a building at Apple’s new headquarters in Cupertino, Calif. The company said Wednesday that it planned a $350 billion contribution to the American economy over the next five years. SAN FRANCISCO — Apple, which had long deferred paying taxes on its foreign earnings and had become synonymous with hoarding money overseas, unveiled plans on Wednesday that…