The Pathfinder SRD has a great page on how you advance monsters. In this case, you want to use the second option listed (adding class levels). It's actually very similar to adding a class level to a PC, with a couple of big exceptions.
When you add a first class level to a monster, this happens:
The first step of this process is to modify the creature's ability
scores. Creatures with class levels receive +4, +4, +2, +2, +0, and –2
adjustments to their ability scores, assigned in a manner that
enhances their class abilities. Creatures with NPC class levels do not
receive adjustments to their ability scores.
Next, do the usual level advancement:
Next, add the class levels to the monster, making all of the necessary
additions to its HD, hit points, BAB, CMB, CMD, feats, skills, spells,
and class features. If the creature possesses class features (such as
spellcasting or sneak attack) for the class that is being added, these
abilities stack. This functions just like adding class levels to a
character without racial Hit Dice.
Next, recalculate the CR and treasure. There's a table for this at the link I gave, it's somewhat large to quote here.
Note that if your first HD is from an NPC class or a monster racial HD, you do not gain max HP from it like a PC would at level 1. If the first HD is from a PC appropriate class, the creature does gain max HP. So something with monster stats where you add a PC class on top does not get max HP from that class HD (calculate it normally).