The best places to convert your dollars into Yuan are at your hotel's front desk or a branch of a major bank, such as Bank of China, CITIC, or HSBC. All these operate with standardized government rates—anything cheaper is illegal, and thus risky. You need to present your passport to change money.
Although credit cards are gaining ground in China, for day-to-day transactions cash is definitely king. Getting change for big notes can be a problem, so try to stock up on 10s and 20s when you change money. ATMs are widespread, but not always reliable. Hunt around enough, though, and you're sure to find one that accepts your card.