where should I instantiate the DUT object? In the testbench file or in the task?
The DUT module should be instantiated in the testbench module file.  Modules can't be instantiated in a Verilog task.

See also:
Can anyone help me to create a Verilog testbench?