Well, the AIRasterizeSuite (AIRasterize.h) will have tools that let you convert sets of art into raster objects in Illustrator. And the AIArtSetSute (AIArtSet.h) has methods that let you construct said art sets from the contents of layers. From there, you'd have to take the contents of the generated raster objects and save them out manually to JPEG.
Oh, just found another that might be what you want. AIImageOptimization.h has methods like 'AsJPEG', which seem to take an art handle (which could be the group at the root of a layer from the sounds of it). So that would presumably let you do dump that to JPG. It uses AIDataFilters though, and I don't know how those work.
I think this has come up before in this forum, so if you do da little searching you might come across some better help than me. It's definitely doable though.