I have 622 × 17 rims on my hybrid and currently have 700×40c tyres on (came with the bike).
I need a new rear tyre but I am not sure what I can get. From what I can find I should be fitting fairly narrow tyres in the 25-28C range?
If you don't have a specific reason to change size, get the same.
This kind of combination is common, but over the last years there has been some fuss about too narrow rims, in some part because people with limited riding experience like to repeat what they have heard and in part because manufacturers are pushing wider rims.
Do a google search for 'bicycle tire rim width' and you'll find many charts that give the ranges of tire width ranges for rim widths. A 40mm tire is well within the range of a 17mm rim.
You can go to a 32mm tire, and you might get slightly better rolling resistance, but probably not as much as you are hoping for.