I make mine with shea butter an cocoabutter and no grainyness yet.
I put the cocoa butter, almond oil and castor oil and beeswax in a small pan and heat VERY gently until it just melts, then take it off the heat stir a while until they are fully melted, then add the shea butter and stir some more. After that add the flavour and pour.
It means I have to work very fast aftr the shea butter is added or it starts to set in the pot, but no grains yet and my daughter carries hers in her pockets, so it warms up and cools down all the time. They never last too long, but I have a jar here in front of me thats 2 months old and no grains in that one either (and it's been in the car and in the cold)