There exists an managed library called PeNet which is available as open source and as a NuGet package, too. You can access and change nearly all structures in the PE header with this library. PeNet GitHub
Disclaimer: I'm the main author of the library