How do I create a 'page' that creates and downloads a file from within a module
Don't forget anything you can do with PHP you can do with Drupal, so headers work in exactly the same way. 

Adding a page callback which sets headers and exits the script (with drupal_exit()) is definitely the right way to do this:

function MYMODULE_MENU() {
  $items['mypage'] = array(
    'title' =&gt; 'CSV',
    'access arguments' =&gt; array('access content'),
    'page callback' =&gt; 'MYMODULE_deliver_csv'
  );

  return $items;
}

function MYMODULE_deliver_csv() {
  // Full complement of headers so IE behaves
  header("Cache-Control: public");
  header("Content-Type: application/octet-stream");
  header("Cache-Control: no-store, no-cache, must-revalidate");
  header("Cache-Control: post-check=0, pre-check=0");
  header("Content-Disposition: attachment; filename=\"filename.csv\";" );
  header("Content-Transfer-Encoding: binary");

  // Print your CSV data here

  // Exit the script
  drupal_exit();
}