China has urged the United States to stop using state power to harm foreign companies and is warning of countermeasures.