Jesse Bunch wrote a nice tutorial on getting under the hood using CodeIgniter in ExpressionEngine 2.0. He describes his problem:
… [W]hen I needed to create a simple web service that would consume an XML post and update the ExpressionEngine database, I found myself in limbo—that is—not needing the control of a module, but needing more control than that offered by an accessory.… The idea here is to have the power of the CodeIgniter libraries and make use of the ExpressionEngine API. Choosing this method will prevent model redundancies and make for a much smoother upgrade day.
As always there are there are plenty of ways to do this. Some people would have just written a module or some sort of external script, but I like the idea of harnessing the EE API to do it without having to go all in with a module.
Read how he did it along with some code examples: Harnessing the Power of CodeIgniter in ExpressionEngine 2.0