The main role of a Dreadnought is to deal massive damage to big, almost-stationary targets, 99% of the time in PvP.
Its main advantage is in being the only non-Supercap which can fit Capital-sized weapons, and the only type of ships which can use the Siege Module (turns you immobile, massive damage and defense boost, and you won't be able to shoot anything smaller or faster than a cosmic elephant).
A dreadnought is invaluable in taking down POSes, and give you the best damage per buck when it comes to damaging Capitals and Supercaps. (Even if the dreaded Supercarriers (Motherships) are extremely efficient in that regard with their fighter bombers, it's less cost-effective generally.)
In a (good) corp fleet, you will be called either for POS bashing or in a big enough skirmish where the enemy fields Carriers. The most used Capital is the Carrier, and it's the most useful in a subcap engagement. You role will be to shot them down to cripple the enemy's logistics (and occasional Fighter swarm). Expect to be commanded by a separate target caller than subcaps, and in good fleets, you will also be told when to cycle your Siege Module.
There is not much use for dreadnoughts other than that. However you can always find interesting side uses.
The dreadnought is one of the 2 only combat-oriented Capitals which can get into a W-space system. (The other being the Carrier.) That means it cannot run into a Titan or a Supercarrier there, which makes it significantly less easy to kill.
W-based corps will generally use dreadnoughts as a way of preventing any hostile POS installation in "their" system. It's also one of the rare cases where the dreadnought can be used in PvE. In class-5 and class-6 W-space systems, a dreadnought's firepower is very appreciated to take down Sleeper BSs, providing someone paints and web them a bit. It's a better strategy than offensive Carriers, as Sleepers will frequently kill your expensive Fighters.
Protip: do not forget the fuel for the Jump Drive and the Siege Module.