Ok... Lets start with the tank - 40g breeder typically has 36x18 footprint - not a huge tank for mbuna but it is feasible to hold some species.
4 - 7 of Yellow Labs is not a problem. Try to keep as little male (1 if possible) and the rest as females and you will be ok.
Demasoni is far trickier. Although I don't have them yet, I will be setting up a breeder setup in the near future, so I had to do quite a bit of reading on these species on the net. These guys are soooo brutal within their own species that in your sized tank, anything less than 12 would most likely end up with one demasoni at the end! If you want some blue, I suggest you get some other species that are less brutal than demasoni. I would personally not create a 40g breeder setup that contain Yellow Lab, Demasoni and another species - sounds like a recepe for disaster...
If you like Blue and Yellow (with that color morph between male and female), why not try Pseudotropheus Saulosi and Pseudotropheus Acei? Melanochromis Johanni also has the color morph but is a little more aggressive compare to Saulosi, but is a possibility if you are willing to have lots of rocks.
Personally, I mixed Yellow Labs and P Acei - they get along great and they breed like rabbits!