Foxconn, the Taiwanese electronics contract manufacturer to many U.S. tech giants, will spend $30 million on a new factory in the Harrisburg, Pa., area that will employ up to 500 people, according to state officials.