I've found that peppermint and clove oils are the most effective at getting rid of carpet beetles because they not only repel these insects but also kill on contact.
I put a few drops of each oil on a cotton ball, then place the cotton ball in the areas where I'd seen the beetles.