Custom Post within a custom post

Okay the answer is simple (was able to fix this myself).

What you need to do is put another directory (let’s call it C) where the rewriting rules will be made.

So for post type B, it would be:

$args = array(
    // ... other args removed for clarity
    'rewrite' => array( 'slug' => 'A/C/B' )
    // ...
);

It’s a bit cumbersome but it works nevertheless.