Ejecting external storage devices before physically disconnecting them is really important even if it seems like it's a bit pointless. This could really corrupt the partition and/or the file system.
On the other hand it's weird that if this is the only issue, you won't be able to format it. Perhaps the flash drive has failed which might be the reason for you to be having those issues.
You could still try one other thing - low level format.
1. Open CMD as admin
2. Type
diskpart and press enter
3. Type
list disk and press enter
4. Type
select disk X and press enter. Here "X" is the number of the drive you wish to select, so don't forget to change it with the correct one. Make sure that you've selected the flash drive, as this process is data destructive and it would be a shame to delete all the data you have on another drive. You should be able to recognize which one is the flash drive by its size.
5. Once you receive the message "disk X is now selected" or something similar, type
clean and press enter.
Once the process is completed go back to Disk Management and try to reformat it again.
edit: I had the thread opened and didn't realize you have already broken it and this is now useless.