Is it possible to have a Travel Matte?

for example:

Layer A is a background such as a sky
Layer B is a black and white image that acts as a mask
Layer C is a different clip which only displays in the black or white area of layer B

My specific application is projecting onto a 3d set that has a cutout shape in the foreground. I would like to project a different image onto the cyc in the background and be able to project another layer inside a mask that is the same shape as the foreground cutout.

Cheers

Toby