Using class id from array for query

Try this after your $wpdb query:

// collect calendar id's
$ids = array();
foreach( $calendar_entries as  $calendar_entries):
        array_push( $ids, $calendar_entries->id );
endforeach;

// query the above calendar id's
$args = array(
    'post_type' => 'post',
    'post__in' => $ids,
    'orderby' => 'id',
    'order' => 'DESC'
);
$query = new WP_Query( $args );

You can also modify the WP_Query by using posts_where, posts_join
and posts_clauses.