These are sometimes called nested containers.
B could be called:
- the second container in (in implies counting from the outermost container)
- the second container out (out implies counting from the innermost container)
(In your example, the "second container in" and the "second container out" happen to be the same container, because there are only three containers. But in a set of six nested boxes, B would be the second container in, and E would be the second container out.)
You could also call it the penultimate container, if you wanted to use a fancy word. Penultimate means "second to last".
If you wanted to reference container B in relation to container C, I would recommend the word directly:
B is the container directly outside of C; C is the container directly inside of B.
One meaning of directly is:
directly (adv.) with nothing or no one in between; exactly in a specified position
(definition from NOAD)