Two ways to do this:
Plain SQL:
$this->db->query('SELECT * FROM categoryTable WHERE categoryId NOT IN (
SELECT categoryId FROM userMenuTable WHERE cookieId = "bang4b544417a41b6"
)');
Active Record + Plain WHERE SQL
$this->db->where('categoryId', 'NOT IN (
SELECT categoryId FROM userMenuTable WHERE cookieId = "bang4b544417a41b6"
)', FALSE);
$this->db->get('categoryTable');
You can put Plain SQL into a WHERE clause by adding FALSE in as the third argument in db->where();
It is a shame there is nothing neater for doing this, but Active Record is only intended for simple queries with joins, orders, limits, etc.