How hard are they to keep?
No harder than other tropical fish as long as you do plenty of research.
Is 40gal a good size?
40UK gallons are around 48 US gallons, not the greatest size to start with, 55gal would be better. The really important think with african cichlids is tank dimension, while they will swim in the upper parts of the tank, they really need the floor space to set up territories, for example a rectangular tank gives more floor space than a corner, or hexagonal tank, and would be more suitable for cichlids. If you can't go larger than 48gal, there are still options.
what could i put in the tank?
I'll add a couple of links that can give you some ideas, but usually the easiest thing to do is to go to your LFS and write down the species available, then research them and post potential stocking lists so we can help you out.
A few musts for african cichlids (mbuna).
1. Never never never buy a fish that you haven't reasearched first. Some mbuna can be extremely aggressive and will happily kill off your entire tank, and unfortunately most LFS will carry them. Just because it's pretty doesn't mean it's docile.
2. With few exceptions, male to female ratios are important. Most mbuna are harem breeders, meaning a single male will try to breed with any available females. It's important to have multiple females to every male so that a single female won't be bullied if she isn't ready to breed. Also depending on the speices, you should only have one male per species (especially in a smaller tank) as the dominant male won't tolerate other males and may kill them.
3. If you think you have enough rockwork caves and crannys add more. Mbuna will often claim more than one territory so it's important to have plent of caves and crannys to claim.
4. Never buy fish from a "mixed african cichlid" tank, most of these are hybrids, and while I won't get too far into that subject, there is really no way to know what their temperment will be like if you don't know their parentage.
5. Did it mention research? Research is important with any tank, but doubly so with mbuna, without research you could end up with a single fish and a bunch of floaters. I don't want to scare you, just make it a little easier.
6. Filtration. Over filtering is necessary as mbuna tanks are generally overstocked to help with aggression. You want to overstock so any dominate fish have so many other fish to chase that no one fish gets picked on constantly. You want your filter or filters to be able to filter the entire tank 6-10 times.
7. Stocking. Most people have had the best luck with stocking their entire tank at once or in two large batches. That's because mbuna quickly set up territories in the tank and will look at any new additions as intruders. You can change the rock work every time you add fish to mix up the territories, but that can be a pain, and not always effective. This is why fishless cycling is recommend for mbuna tank.
http
/www.cichlid-forum.com/articles/cookie_cutter_40g.php
http
/www.cichlid-forum.com/articles/cookie_cutter_55g.php
Hope I didn't overwhelm you, if you have any more questions feel free to ask.