As @Knn9 said, its not too difficult to build a DLL keeping in mind simply changing Visual Studio build setting and changing the entry-point of the program to:
I suggest you look at YouTube videos regarding this topic: https://www.google.co.uk/search?q=create+dll+using+code+blocks&rlz=1C1LENN_enGB499GB499&oq=Creating+DLL+using+Code&aqs=chrome.1.69i57j0l4.4870j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8#q=create+dll+using+code+blocks&tbm=vid