For the most part, African-American soldiers were treated very well by British civilians, they opened up their bars and homes to them and there was certainly a good amount of co-habitation between British girls and Black GIs. Some British, in opposing the segregation and use of the color bar for Black GIs starting instead barring white soldiers from their establishments, signs that read "For British people and coloured Americans only." started popping up in bars across the country. There weren't great numbers of blacks in Britain at this time, so relations between the two groups were very positive overall.This presented a real problem to the American military and government which both supported segregation and lead to a lot of tension between British civilians, White GIs and Black GIs. One farmer would state "I love the Americans but I don't like these white ones they've brought with them." The British would take a further stand in 1942 with this note from the home office:
It is not the policy of His Majesty's Government that any discrimination as regards the treatment of coloured troops should be made by British authorities. The Secretary of State, therefore, would be glad if you would be good enough to ensure that the police do not make any approach to the proprietors of public houses, restaurants, cinemas or other places of entertainment with a view of discriminating against coloured troops.
These racial tensions seriously inflamed with the 1943 "Battle" of Bamber Bridge. In 1943, two white military police were sent to arrest black soldiers who were absent without passes, when the MPs tried to arrest the men, the British civilians in the bar stood up for the black soldiers and the MPs left. When the black soldiers left to return to their barracks, a group of white MPs ambushed them and a fight broke out with stones and bottles being thrown. Shots were fired and a black soldier was hit in the neck, with this, a rumor spread through the town like wildfire that the MPs were gunning for black soldiers. Throughout the night, white Britons attacked American military police, the fighting ended when the American MPs showed up with an armored car complete with machine gun and shooting broke out between the white military police and the black GIs. One man was killed and several wounded, 35 were arrested for mutiny but most later returned to active duty.
The most comprehensive book on this subject is the 1988 When Jim Crow met John Bull: Black American Soldiers in World War II Britain by Graham Smith. This detailed work covers the gamut of British-Black relations from 1942-1945 and lays out some serious groundwork for future research. I'd highly recommend it for those looking to dig into the British home-front, race relations, and Anglo-American relations during World War II.
As the other answers have suggested, in short: a lot better than by the average American, although still not perfect by any means.
I'm answering because there is a pretty useful lens to look at this question from: by comparing it to the treatment of black West Indians in the UK at the same time.
During the war, thousands of West Indians cam to Britain to work in factories, filling in for men conscripted into the army. Their chief representative in Britain was arguably Britain's most famous sporting star of the 1930s, Trinidadian cricketer Learie Constantine.
Constantine's own autobiographical writing, particularly his 1954 book Colour Bar, describe the treatment of black people in Britain in great detail. Constantine's own experiences inform this - he worked in the North-West of England, where for many he was the first black person they had met.
Constantine characterised the pre-war period as mostly one of ignorance and curiosity. Although he faced assumptions of racial inferiority, he generally found people to be open and accepting. It's worth noting that Constantine was a middle-class, married (his wife was also Trinidadian), well-educated and well-spoken star of the local cricket team (and, indeed, probably the highest-paid athlete in Britain in the 1930s), so he undoubtedly received far better treatment than any of his compatriots. Nonetheless, the fact that he does not note any outright hostility is useful.
During WWII, Constantine repeatedly notes his anger at the attitudes of the US authorities, particularly the maintenance of segregation at dances and parties. He was repeatedly asked to remind West Indian workers not to attend US parties, and was on at least one occasion asked to leave a dance by a white American officer.
The most notable incident came in 1943, when Constantine was refused service by the Imperial Hotel in London, on the pretext that it would offend the American guests. Given that the hotel had earlier confirmed that Constantine's colour would not be a barrier to service, we can at least assume that this excuse is partially true.
Constantine sued the hotel successfully, a case which led to the passage of the first Race Relations Act in the UK, although the Act was not passed until 1965. Constantine's high profile, political connections and popularity undoubtedly influenced this decision, however, so it is not difficult to imagine other blacks facing this problem without legal recourse.
Post-war immigration from the West Indies to Britain met a far greater degree of hostility and racism. This may have more to do with the nature of West Indian immigrants after WWII - predominantly young and well-educated, and in sufficient numbers that a widespread pattern of racism could be observed (as opposed to isolated incidents).
Anecdotal evidence from oral histories such as D. Hinds, Journey to an Illusion: The West Indian in Britain or M. Phillips and T. Phillips, Windrush generally supports this thesis - before and during WWII, there was comparatively limited prejudice, especially in comparison to the racism and discrimination of the post-war period.
So in short, you would be treated better by the locals than by your own army. There wouldn't have been any issues over attending mixed-race parties or dances and while you would still have met with prejudice and, at times, hostility (particularly when it came to sexuality), it would largely be borne out of ignorance rather than ideas of racial superiority. It is worth noting that Constantine himself came to Britain as he wanted to become a lawyer, a goal which would have been almost impossible for a black man in Trinidad and Tobago, but became possible in Britain.
If you are interested in the treatment of blacks in Britain before the 1950s, Colour Bar is an excellent read. It's short, well-composed and captures the personality of a pretty extraordinary figure in 20th century British history.
While not Britain, the presence of African-American troops in France created tensions both within the US force and between the US and local French authorities. As Mary Louise Roberts recently noted, soldiers often sought out sex during the invasion and occupation of France in 1944 and '45, including African-American soldiers. However, social and racial tensions led to a series of rape cases against soldiers, and while white soldiers tended to escape prosecution, black soldiers were often found guilty (and in some cases lynched for their crime). If you are looking for a comparative, check out the last chapter in Robert's What Soldiers Do.
Also, Paul Gilroy's Ain't No Black in the Union Jack provides one analysis of how race was constructed in Great Britain.