People make a lot of claims about there being black confederates. Recently Virginia got in a controversy about their 4th grade textbook repeating the claim that there were thousands. Mostly though, it is myth. About 99 percent so.
Undoubtedly, black slaves played an important role in the Confederate Army, not just as laborers, but also thousands of body servants brought to war with their master. While there are verified reports of isolated instances where these men wielded arms against Union soldiers in dire situations, they were never organized into any sort of unit of black soldiers - free or slave. One representative example I have read:
But unless readers think that black Confederates were truly enamored of the South’s cause, Stauffer related the case of John Parker, a slave forced to build Confederate barricades and later to join the crew of a cannon firing grapeshot at Union troops at the First Battle of Bull Run. All the while, recalled Parker, he worried about dying, prayed for a Union victory, and dreamed of escaping to the other side.
“His case can be seen as representative,” said Stauffer. “Masters put guns to (the heads of slaves) to make them shoot Yankees.”
However, at the very end of the war there was the eventual, reluctant endorsement of raising black regiments that the Confederate Congress passed in March of 1865. The idea had been raised previously and immediately shot down, but with pretty much no other alternative at that point, the measure passed. However, the bill made no provision for granting freedom to slaves who served (and of course they needed the blessing of their master). With so little inducement, not to mention the fact that all were well aware liberation was at hand, only a few handfuls ever showed up in Richmond before its capture a few weeks later. And support within the Confederate ranks was mixed as well. While some supported the desperate measure, others were vocal in their opposition, such as the fire-eater Robert Toombs, who stated, “The day that the army of Virginia allows a negro regiment to enter their lines as soldiers they will be degraded, ruined, and disgraced.”
Now as I said though, it is 99 percent myth, not 100 percent!
In Louisiana, there was an exception. The societal views of race differing from their fellow Southern states, free people of color and mulattos enjoyed a much greater degree of acceptance, and even served in the militia. With the beginning of the Civil War, a unit of some 1,000 black soldiers was raised in New Orleans as the Louisiana Native Guard. Except for the regimental commanders, even the officers were drawn from people of color. The Native Guard never saw use, and was never even issued arms or uniforms, which they had to provide out of pocket. With the capture of New Orleans in early 1862, the Native Guard disbanded, never having seen action, let alone any real use. Shortly thereafter, the Native Guard was reformed under Union control, incorporating a number of the former Confederate soldiers.
I've heard that Tennessee had a similar native guard type unit which similarly never saw combat - never even received arms, but I've not read enough about them to comment more than saying it existed.
Noted Civil War scholar James McPherson answered this as well in the AMA he did in /r/AskHistorians.
Follow up question: Prior to the civil war, black men had served in the US Navy for decades, and continued to do so through the civil war.
What about the CS Navy, were black men employed at sea?