My best results were when I allowed myself to gain enough weight that I was slowly getting fatter and fatter. I got up to 22% bodyfat and gained a lot of muscle and strength. Carbs are very important. I used to eat a high protein, moderate fat and fairly low carb (compared to most people) diet and I got slow results. Once I started upping my carbs significantly, the mass and strength started to just pile on. Carbs are the key, assuming protein is sufficient of course. As I said, my best results were when I let myself get fatter... in the past I would always stop bulking around 15% bodyfat because I was scared of getting too fat, so I would cut back down to 8-10% bodyfat before bulking again. It seemed like a never ending cycle... bulk a few months, cut a couple months, rinse, repeat.
I finally figured... cutting is easy, I know how to lose the fat, that's not a problem. So why do I keep compromising my gains by stopping my bulking cycle when I get scared of the fat? I kept going, bulked for probably 6-9 months straight, kind of like a gestational period in the womb... hit tons of PRs, gained a lot of mass, and then I spent a good several months slowly cutting down, kept pretty much all the new muscle, not only maintained strength but improved it. So, the moral of my story is that getting fat was one of the greatest things I ever did for my physique and my strength.
General rules for me when trying to gain mass:
Eat as close as possible to 2 grams of protein per lb of bodyweight (appx 4 grams per kg of bodyweight)
20-30% of calories from fat
Remainder from carbs - preferrably more complex carbs but sugars prior to lifting is ok
Total Calories should be equal to 18-20 x bodyweight in lbs (appx 40 - 44 x bodyweight in kgs)