Make sure you're doing this for a good reason, a simple function like the following would allow static typing and allows your IDE to do things like "Find References" and Refactor -> Rename.
public Task <T> factory (String name)
{
Task <T> result;
if (name.CompareTo ("A") == 0)
{
result = new TaskA ();
}
else if (name.CompareTo ("B") == 0)
{
result = new TaskB ();
}
return result;
}