Decoding mp3/ogg or other loosy/high compression formats requires some horsepower from microcontroller. I've seen somewhere a library which can do that but in ARM Cortex-M3 @ 72 MHz (people reported that it doesn't work below 48MHz). With simple MCU like AVR, PIC16 or PIC18 or MSP430 you can play wav/midi at most (maybe other uncompressed formats).
As for DAC it's the way mshrestha789 said. If you have table of samples and send them to DAc at fixed frequency which is the same as audio file sampling frequency then you can play sound. You only have to amplify the output signal a little with some opamp and couple capacitively to headphones (to remove DC component and get AC signal with zero in the middle)
edit:
You also need to specify what kind of DAC you want to use, because they come in great many varieties with broad range of parameters. You need to specify at least resolution, type and interface kind.