There are adhesive removers on the market that remove the glue. A large hoe-type tool is sold in the big box flooring departments to help remove the glue. Remove as much of the glue as you can, so your new floor will not be affected by different levels on your subfloor.
It will pull up, but it will be hard. The mess comes when you remove the glue. Glue removers don't work. I used hot water and Mr. Clean and got on my hands and knees, work a little area at a time. Patience. Floor sanding will take care of the rest.
Take up a corner of the carpet and start pulling gently. If you can, pull off the carpet without harming the wood. Otherwise, use an adhesive remover and release the glue from the wood. Use more adhesive remover to remove any remaining glue. The wood may need refinish work.