I always bun before my hair is completely dry, maybe 75% dry or less. I make sure my hair has plenty of oil in it and the ends are saturated before I tuck them in. Then I tie my hair down as tight as comfortably possible and let it finish drying (usually overnight). In the a.m., my hair is neat as a pin, nice and flat. I don't even comb my hair before bunning when doing this. HTH!
ETA: Even if I'm bunning at the last minute, like I sometimes have to do before church, I will oil and tie down well. I leave it like that until I get to church. Tying down the bun really helps smooth the appearance.