Preheat the oven to 180C/350F/Gas 4. Line a baking tray with parchment paper or a silicone mat, and set aside.
Using a handheld or stand mixer, beat together the butter, and sugar until combined. Mix in the flour, cocoa powder, cornflour, spices, and milk until smooth and combined. The dough will be quite thick, but it should be pipe-able.
Spoon the dough into a piping bag fitted with a star nozzle, and pipe 5cm/2-inch diameter swirls onto the prepared baking tray, spacing them about 3cm apart.
Bake for 10 - 12 minutes or until firm. Cool for 5 minutes before transferring them to a wire rack to cool completely.
For the Filling
Using a handheld or stand mixer, beat together the butter and icing sugar until light and fluffy. Add the vanilla, pumpkin, and spices, and mix until smooth and combined.
Transfer to a piping bag and pipe a thick swirl on one cookie. Sandwich with another cookie, and repeat with the remaining cookies.
Notes
Viennese Whirls keep fresh stored in an airtight container in the fridge for up to 1 week. They also freeze well, wrapped individually, for up to 3 months. Thaw overnight in the fridge before serving.