In researching this article, I found some conflicting information. I tried to incorporate all of the information I found, indicating where the information didn't match.
The first motorcycle was a bicycle with a two-cylinder steam engine attached, which was powered by coal or charcoal, and the connecting rods directly drove a crank on the rear wheels. It was built in 1867 by an American, Sylvester Howard Roper, who also invented a steam car.
Roper took his steam-powered bike and demonstrated it at fairs and circuses in the eastern United States in 1867, but it did not catch on. However it did use many features that are still being used today, most notably the twisting hand grip throttle control.
This machine predates the invention of the safety bicycle by many years, so its chassis is also based on the "bone-crusher" bike. Bone-Crushers appeared around 1800, used iron-banded wagon wheels, and were called bone-crushers because they had a very jarring ride, and they also had a tendency to throw off their riders.
It is thought that the first true gas engine motorcycle forerunner was built by Gottlieb Daimler (yes, that Daimler, of Daimler-Chrysler fame). The engine may have been invented by an engineer named Nicolaus August Otto, who also invented the first four-stroke internal combustion engine. Otto called it the Otto Cycle Engine.
There is some confusion as to whether Daimler used Otto's engine or built one of his own. Whichever, Daimler powered his "bicycle" by attaching an engine to a wooden bicycle about 1885.
The reason this may not be considered the first true motorcycle is because it had two small wheels, used to stabilize the bike, similar to training wheels on a child's bicycle today. Therefore, it was actually a four-wheeled vehicle. However, today there are three-wheeled vehicles and bikes for the disabled with two stabilizing wheels and these are all considered motorcycles, so who is to say whether Daimler's four-wheeled vehicle was a "motorcycle" or not?
Daimler quit building powered bikes and went on to establish himself in automobiles and left the development of two-wheeled motorcycles to others.
There were many engineering difficulties to overcome, and early motorcycle builders worked hard to solve these problems. Should the engine be on the rear of the bicycle, the front, or off to the side? After many trials and errors, it soon was understood that in order for the bicycle to be stable, the engine had to be centered between the wheels and close to the ground.
How many cylinders would be the best? Should the designers incorporate a two-stroke, or a four-stoke cycle? Some early bikes were started by peddling, then after it was started and balance was achieved, the engine took over. What about the pedals: could they be dispensed with? What about the chain, should it be kept, or some other method, such as a belt, be used?
In the decade from the late 1880s, dozens of designs and various machines emerged, particularly in France, Germany and England, and soon spread to America. During this early period of motorcycle history, there were many manufacturers, since many bicycle makers were adapting their designs for the new internal combustion engine.
In 1894, the Hildebrand & Wolfmuller became the first motorcycle for sale to the public. However, only a few hundred of this motorcycle were ever built. I couldn't find any information about whether production was halted due to lack of sales, lack of interest, financial reasons, or some other reason.
Engines became more powerful, and designs were starting to veer away from bicycle origins, and the number of motorcycle-oriented makers increased.
It is said that the first motorcycle (other than Roper's) in the United States was taken to New York in 1895 by a French circus performer. It weighed about 200 lbs and was capable of doing 40 mph on a level surface. I don't know if he used it as part of his act, or for personal transportation.
In the same year, E. J. Pennington demonstrated a motorcycle which he designed in Milwaukee. He said it would do 58 mph. Pennington is credited with coining the term "motor cycle" when describing his invention.
Motorcycles have come a long way since the days of a wooden bicycle powered by coal, but I bet those guys had just as much fun on theirs as we do today.