Is there a book which is available that covers the very first Space Marines and how they were, and why they were created? If not a book does anyone happen to just know?
There is a short story called "The last church" by Graham McNeil.
I think that this is one of the parts you might be interested in.
"‘I have,’ replied the Emperor. ‘It is my dream. An Imperium of Man that exists without recourse to gods and the supernatural. A united galaxy with Terra at its heart.’
‘A united galaxy?’ said Uriah, averting his gaze from his blazing church as he finally grasped the scale of the Emperor’s ambition.
‘Indeed. Now that Unity has been achieved on Terra, it is time to reclaim humanity’s lost empire among the stars.’
‘With you at its head, I presume?’ said Uriah.
‘Of course. Nothing of such grand scale can be achieved without a singular vision at its heart, least of all the reconquest of the galaxy.’
‘You are a madman,’ said Uriah. ‘And you are arrogant if you believe you can subjugate the stars with warriors such as these. They are powerful to be sure, but even they are not capable of such a thing.’
‘You are right,’ agreed the Emperor. ‘I will not conquer the galaxy with these men, for they are but men. These are the precursors to the warriors I am forging in my gene-labs, warriors with the strength and power and vision to bestride the battlefields of the stars and bring them to compliance. These warriors shall be my generals and they will lead my great crusade to the furthest corners of the galaxy.’
Emperor unified Earth using Thunder Warriors - a genetically modified super soldiers, created from his adult supporters. Unfortunately, those soldiers were overly aggressive, short-living beasts, that could be used as a living weapon, but nothing more: In many ways they represented the worst aspects of Mankind's nature rather than its best.
Therefore after the end of the Unification War Emperor has staged an accident, that killed all of the remaining Thunder Warriors and he started much more ambitious project: using his own DNA he created 20 children, an almost godlike beings, that will be future generals in his Great Crusade. Knowing that Chaos will be opposing his plans, he has hidden the laboratory beneath Gellar field. Unfortunately Chaos found a way to disrupt this program by sending back in time group of Word Bearers (and separately - the Warmaster Horus himself) - as described in the "First Heretic" and "False Gods"- , who destroyed the protection over the laboratory and caused the children to scatter over the galaxy.
"They shall be my finest warriors, these men who give of themselves to me. Like clay I shall mould them and in the furnace of war I shall forge them. They shall be of iron will and steely sinew. In great armour I shall clad them and with the mightiest weapons shall they be armed. They will be untouched by plague or disease; no sickness shall blight them. They shall have such tactics, strategies and machines that no foe will best them in battle. They are my bulwark against the Terror. They are the Defenders of Humanity. They are my Space Marines...and they shall know no fear!
Emperor created 20 legions, each counting between 80k-200k+ marines and started searching for his lost sons, finally founding them all (and killing/banishing two of them).
In "False Gods" Horus witnesses the creation and scattering of the primarchs in a vision given to him by the chaos gods while healing in the Temple of the Serpent on Davos. Not specifically the Adeptus Astartes but their forbearers and leaders, if I am not mistaken each primarch formed the template for the gene seed that would build his legion.