Roll Dungeons and Dragons dice
Perl, 109 95 93 96 89 bytes

s/^d/1d/;/^(\d+)d(\d+)(\+\d+)?$/;$d+=1+rand$2|0for
1..$1;$_=$1*$2?$d+$3:'Invalid input'


Requires the -p switch, which accounts for two of the bytes. Try it online on Ideone.

How it works


Because of the -p switch, a line is read from STDIN and stored in $_.
The command s/^d/1d/ prepends a 1 to $_ if it begins with a d, i. e., if the number of dice has not been specified.
The regular expression /^(\d+)d(\d+)(\+\d+)?/ checks if the line consists of a number, a literal d, another number and, optionally, a third number preceded by a + sign.

If there is a match, the numbers will be saved in $1, $2 and $3.

In this case, the input will be valid if and only if $1 and $2 are both positive.
$d += 1 + rand $2 | 0 adds a pseudo-randomly chosen integer from 1 to the specified number of sides to $d (initially treated as zero).
for 1 .. $1 does the above once for every integer between 1 and the number of dice.
The command $_ = $1 * $2 ? $d + $3 : 'Invalid input' does the following:


If $1 * $2 is zero, it sets $_ to Invalid input.
Otherwise, the input is valid and it sets $_ to the sum of the dice rolls and the modifier.

Because of the -p switch, Perl prints the contents of $_.
Since there a no further input lines, the script exits.