London can be hot and crowded in August but given its to celebrate your 40th you probably have a small window. If you think you may want to do any day trips out of London in August be aware the traffic jams are a nightmare- do a day trip by train eg Brighton, Bath, Salisbury....
If a group of you and girlfriends can go then definitely go for an apartment - in 2010 we stayed in a great one in a renovated warehouse in the Docks area just near Tower Bridge on the south bank. There were some amazingly swish ones for not a lot more than a daggy hotel (our wasn't super swish but comfortable with a balcony and sideways view of the Thames but it was fitting our family of three and my parents). If you end up going solo then I would stay in a nice B&B-there are lovely ones out there rather than an impersonal hotel-and considering the prices-there are a lot of second rate hotels in London so do your research.
What to see....perhaps start with one of the hop on-off buses to get your bearings and go past everything. Since I emigrated at the end of primary school we have been back several times to see rellies and friends and each time new things wow us. Some of our faves-Trafalgar Square, British Museum (but its huge so pick a few galleries to zero in on) or Sir John Soanes Museum, we like the London Museum which is more of a social history museum but probably better to do that with kids, ditto Science Museum. Convent Garden-have pre-theatre special 2 course dinner in the area (prebook - lots of places recommended on foodie sites and as early dinner get some great specials), wander the market shops and listen to buskers before watching a West End show or wander area, see show, have post-theatre dinner. Borough Markets (south bank-great food market). Tower of London (I know its cliche but we like it). We probably prefer Westminster Cathedral to St Paul's by a whisker but as first time you almost need to visit both. Walk across the Millennium Bridge from St Paul's to the Tate Modern (we are not keen on the Tate as don't like modern art but if you do then you'll have that on your list). We love the parks-its a nice walk through St James across the lake and the view of the towers/spires of Buckingham palace is a classic-it looks like a castle surrounded by greenery. Hyde Park at dusk is also lovely. Pick an area, wander the streets, shop. You can organise days by geography (bit like WDW parks) and cluster what you want to see to save your legs..and don't be fooled by the Underground Map which is not geographical. Sometimes it can be easier to come above ground and walk a short distance to your destination than muck about with transfers of lines.
Ok I've bored you all now-I will shut up.