Are there any open source libraries available to mutate PDB protein residues? If so are do you have any examples of them?
However, if you are more interested in the process rather than the result, I would suggest taking some PDB IO library, say, PDB Record IO Libraries from UCSF, open-source, C/C++, read your PDB data and write a mutation function according to your needs. With that, you would avoid the development of PDB IO and storage and focus on the interesting parts.
This is typically done by the molecular simulation software that you use. For example, in NAMD this can be accomplished using the
psfgen command (see page 10 of the user's guide). The source code for this command is written in C and exposes a TCL interface, so chances are that you can adapt it to your needs. Keep in mind, though, that after you mutate the residue you may need to do a short equilibration run to get a reasonable geometry for your system.