How to prevent empty category to list content of sub categories?

Assuming the context here is filtering out posts from category C when viewing the category B posts archive, you could accomplish this by using the query_posts keyword category__in (which does not include posts from child categories) instead of cat (which does include posts from child categories). Just add it in archive.php or category.php depending on what’s appropriate for you theme.

global $wp_query;
$args = array_merge( $wp_query->query, array(
    'category__in' => get_query_var('cat')
));
query_posts( $args );