Yeah it can be tough but if you plan ahead and take your time it is much easier to do. First thing is to ensure you have a good, properly lit greenscreen if compositing people. Of course you want the set lighting to match the 3d lighting as closely as possible and you can tweak the 3d lighting later if needed. I like to use Corona's lightmixer for this.
Once in After Effects and the greenscreen has been removed, it's just a matter of tweaking the matte, color correcting the foreground or background plates (or both) and grading as desired.
But it all boils down to the lighting both in the real world and the virtual world. Corona's tools make preparing for the match really easy once you have your workflow established.