The main thing to do, is to create a set of your own functions to wrap this kind of stuff around. Make them reusable, and then you don't need to bother messing with them too much each time you use them.
For instance, I've just coded a resource cache for my current project, which can keep track of (and flush) textures and meshes. The basic code to do this is pretty lengthy (keeping track of it all) but after wrapping it into a bit of OOP magic, I now just do:
ResourceCache* rc = new ResourceCache(engine);
rc->LoadCacheListFromFile("example.cache");
and that loads all the files from a list in the "example.cache" file. When the object (rc) is delete'd, or another cache list is loaded, all the other crap is erased, and the cache starts from the ground up again.
Anyway, once a basic framework is up and running, things start to become much easier to work with (and pretty much all of it is reusable if you code it correctly)