The average of a die
The average result of a die is ultimately just that, the average of all the values on the die -- or in other words, the sum of all the faces divided by the number of faces.
If it's a d4, that's (1+2+3+4)/4 = 10/4 = 2.5
Because of a quirk of the way even distributions work, on a die you can actually just average the highest and lowest values and get the same answer: (1+4)/2 = 5/2 = 2.5
Since the lowest value is always 1, you can further reduce the calculation to "half the die size, plus a half": 4/2 + 0.5 = 2.5
Multiple dice
When you have multiple damage dice, you can add their averages together, but an easy trick is to remember that the average of two same-size dice is just the highest value plus the lowest -- so a greatsword's 2d6 averages 7 damage, or if you have a spell that does 4d8, you can quickly say that's two 9's, or 18.
And this gets into some statistical math, but something you'll often hear people say in DPR discussions is that "more dice is more average" (or the same thought expressed differently). It's a little counter-intuitive, but in brief, the more dice you roll, the more the randomness will cancel itself out and ensure that the actual result comes closer to the average, while fewer dice means more random results.
In technical terms, we call this the "standard deviation". A large standard deviation means the results are 'more random' -- that is, more likely to fall far away from the average, expected result -- while a small standard deviation means the results are clustered tightly near the average and exceptions are very rare.
Consider the classic Greatsword vs Greataxe. The averages are nearly the same -- 7 vs 6.5 -- but the axe has a 1 in 12 chance of rolling 12 damage, the same as any other value; while the sword has only 1 in 36 (the chance of rolling 6 on one die times the chance of rolling 6 on the second die as well). A greataxe has the same 1 in 12 chance of rolling a 7, while the chance of a greatsword getting a 7 is actually 1 in 6. The 2d6 produces reliable, but not spectacular damage; while the 1d12 is a gamble with a good chance of rolling either very high or very low. Which one you prefer often depends on whether you'd rather risk a crappy damage roll for the chance of a good one or if you'd rather have a boring but reliable weapon.
For a more extreme example, consider the chances of rolling maximum damage on a fireball -- or minimum! Just intuitively, both results are extremely unlikely, since they would depend on rolling 6 (or 1) on many dice at the same time. And if you threw 1,000 d6s and summed them up, the result would almost certainly be very close to 3500 (probably to within a hundred or so), even though the range of results is a huge 1000-6000.
To-hit percentages
Your to-hit values are basically correct. Some people do what you did and figure out the range of the attack die, then compare it to the target; but a more common method is to ask "What do I hit on?" (i.e., what number do you need to roll to match the AC?) Count how many faces on the d20 will result in a hit and then multiply that by 5%. For example, if you have a +6 attack bonus, and the target has AC 14, you hit on an 8 or higher. So that means there are 7 faces that will result in failure, and 13 faces that result in success on this particular roll. 13 * 5% = 65%
The complications come in when you start working with conditionals. If you just have multiple attacks, it's easy enough to multiply the average single-attack DPR by the number of attacks to get your true expected damage per round. But then you get effects that use an "If X then Y" structure, and those require some (admittedly fairly basic) statistical math to figure out, which is too complicated to go into here.