I don't understand about the HTML's header thing, but the basic idea here is to change the header, and follows a file for the user to download.
The link (anything you want, can linked to a function, or using l()) would lead to the execution of a certain function; within that function, it would call the php function header() to return proper header to the browser before drupal does anything, then the file you want the user to download; afterwards, you call die() function to finish execution.
To the browser, it would start to download a file. But for the things you need to put in the header() function, I'm not quite sure also, you may further search on this.
Update: here's the code I've used for providing an excel-readable file for the user to download:
function download_as_excel($header, $rows, $filename = 'result.xls',$pre_content = "",$post_content = "")
{
//Export the table to MS Excel.
header('Content-type: application/vnd.ms-excel; charset=UTF-8');
header('Content-Disposition: attachment; filename="'.$filename.'"');
$output = '<html>';
$output .= '<head><meta http-equiv=Content-Type content="text/html; charset=utf-8"></head>';
$output .= '<body>';
$output .= $pre_content;
$output .= theme('table', array('header' => $header, 'rows' => $rows));
$output .= $post_content;
$output .= "</body></html>";
print $output;
exit;
}