Blocking the camera without blocking lights
You can do the same as you would if you wanted to make the object invisible to the camera yet still cast shadows etc, only in reverse:



This is equivalent to disabling Shadow ray visibility as NoviceInDisguise answered, but with nodes instead. Note that disabling the ray visibility in the object panel helps rendertimes a little more than using nodes, but if you want to use it inside a larger setup it may be necessary to use nodes.