I've got a history of the milling machine from the library that shows Nasmyth's miller that he made for Maudsley about 1829-30 for milling flats on nuts. The illustration shows a hex nut of large engineering size. Presumably, before that they either forged them or filed them to shape(or both). So we're back to the early 1800s, at least.
Stan