How to construct a TaskDialog?

You are calling it wrong. Try this:

import clr
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *

dialog = TaskDialog("Header")
dialog.MainInstruction = "Hello, Revit!"
dialog.MainContent = "This sample shows how to use a Revit task dialog to communicate with the user." "The command links below open additional task dialogs with more information."

dialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink1, "View information about the Revit installation")
dialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink2, "View information about the active document")

dialog.CommonButtons = TaskDialogCommonButtons.Close;
dialog.DefaultButton = TaskDialogResult.Close;

dialog.FooterText = "<a href=\"http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975 \"> Click here for the Revit API Developer Center</a>"

dialog.Show()

#Assign your output to the OUT variable.
OUT = dialog

Cheers!