Connecting TDA7052 with a microcontroller
The datasheet for the TDA7052 specifies an absolute maximum Vin of 5 Volts on pin 2. A simple voltage divider can bring the microcontroller output down below that level. 

If your plan is to use a PWM signal from the microcontroller to output audio signals, then you will need to low-pass filter the microcontroller output. An RC filter used for this low pass would inherently drop the signal voltage down, so you will not need to limit the duty cycle of the MCU output. A voltage divider will also not be required. 

To ensure that the resultant analog (PWM filtered out) signal does drive the amplifier into clipping, the gain control DC voltage applied to pin 4 can be limited such that the gain is just enough to obtain maximum output across pins 5 and 8, with a maximum-amplitude output of the PWM signal - Generate a 0% to 100% PWM "sine wave" at audio frequency to check this. Better yet, limit the DC volume control input to slightly below that level for some safety margin.

Though you probably know the following, just for completeness I'll mention that your PWM base frequency needs to be significantly higher than the top frequency your (presumably) audio signal is expected to span. Nyquist criteria require a bare minimum of twice the signal frequency, but for reasonable audio quality, pushing it up to 100 KHz (5 x 20 KHz) or more might be useful.