register_post_type call, make sure you have these arguments:
'hierarchical' => true,
'public' => true,
'rewrite' => array(
'slug' => 'my_post_type',
'with_front' => false,
'supports' => array(
'page-attributes' /* This will show the post parent field */,
// Other arguments
Make sure your permalinks are flushed (just visit the Settings > Permalinks page).
Now when you create a new
my_post_type, just set it's parent to another and it's permalink will look something like:
You can go as many levels as you need.