(written from a Production point of view)
The introduction of the Borg in the second season episode of Star Trek: The Next Generation's episode "Q Who", has proven to be a milestone in the Star Trek franchise, as they represented an adversary unlike anything seen before and rarely after. The uncompromising, implacable and daunting nature of the race warranted a formidable ship that matched that nature, and they have received it in the form of the Borg cube. The fascination with the race and their vessel led, apart from its appearances in The Next Generation, to repeat performances in Star Trek: First Contact (with an upgraded cube design), the pilot episode of Star Trek: Deep Space Nine, and in the television series Star Trek: Voyager, where the Borg and their vessel made several appearances. Apart from this the cube spawned a derivative design in the form of the Borg tactical cube for the latter production. Starting out as an array of physical studio models, advances in computer technology resulted in the addition into the fold of digital ones as well.
The original concept for the Borg cube was conceived by Maurice Hurley and designed by Richard James. The original studio model was built from "the simple embellishments that Rick Sternbach and Richard James had created based on the description of the cubical ship given in the script." (Star Trek: The Next Generation Companion; Star Trek Encyclopedia) The final draft of the script for "Q Who" read, "The shape of the ship is more apparent. It's box like, with none of the aerodynamic qualities associated with most spaceships including the Enterprise. This is a case of form following function." 
A rudimentary foam core concept model, measuring 9" squared, was later offered as Lot 1305 in the Profiles in History Hollywood Auction #40 of 12 June 2010. Valued at US$800-$1,200, it sold for US$900.
The original physical studio models
Regular studio model vendor Gregory Jein, Inc. had been requested to bid on the project. However, the bid to build the Borg ship, along with the melting section, Enterprise force perspective saucer model and the Enterprise Core Sample, was awarded to Kim Bailey of Starlight Effects, who was contracted by Peter Lauritson to do the built for "Q-Who", and authorized by Earl Lestz (the then head of Paramount Studios). The model was essentially scratch-built layer by layer from custom shapes created by union model makers to make up the inner surface, then was covered with acid etch brass (that was hand drawn and then etched) to create the intricate surface detail applied in multiple layers and lit from within. Each layer was applied as a separate element and built by a crew of 12 model makers led by Gene Rizzardi and Jim McGeachy. The model mount or inner support structure was also a custom built aluminum six point mounting system to hold the model that incorporated a custom model mount rig for Image G, where the model was filmed. The final weight of the Borg cube came to a astounding 60 pounds once completed. As for the final colors, they were chosen by Bailey, who hired model maker Roger Sides of Science Fiction Modelmaking Associates to do the finish detail scaled weathering. The three-foot model was used in "Q Who", both episodes of "The Best of Both Worlds", and "Emissary". Due to its shape, no more than three sides of the cube could be shown at any given time on screen, yet the model is fully detailed on 5 sides with the sixth being left open (requested by Visual Effects Supervisor Dan Curry), allowing the handlers easy access to the innards of the model for adjusting lighting and the like. An added advantage for the handlers of the model was the simpler mounting of the model for its shots.
While recognized as an imaginative design, Visual Effects Supervisor Rob Legato found the model hard to shoot, "That, for me, is quite ugly and difficult to light. You're hampered by the fact that when you put the ship in a particular lighting condition, it looks terrible. You then have to redesign and rechoreograph the shot to put it in its best light." (Cinefantastique, Vol 22, No.2, p. 33) All the footage of the original physical Borg cube model was shot at Image G.
For "Q Who", an enlarged section of a side was built to show the self-regenerating capacities of the cube, and was in fact also constructed by Kim Bailey. Out of frame a high temperature heatgun, operated by Bailey and photographed by David Stipes, was applied to the partial model which made the wax elements melt and the styrene curl inward as it melted. The footage shot was subsequently inserted in reverse in the finalized footage in post-production. After shooting the model was nearly discarded but was saved by Dan Curry and is currently retained by him as part of his own personal collection. . Bailey constructed a special plexiglass case to protect the model and presented it to Curry.
A smaller two-foot break-away model was built by Gary Hutzel and Dennis Hoerter for the finale of "The Best of Both Worlds, Part II", essentially following the same building methodology as its bigger sister. Hutzel recounted, "The Borg explosion in that shot was, of course, very important. It was a pivotal moment in the show. And it had to be really big. So, we had all set out realizing we needed a spectacular explosion. Dick Brownfield was our effects person on the show, at that time. And he'd pulled out the stops, brought out everything. But as usual, we spent all the money on the pyrotechnics and there was no money left to build the ship. The ship had to be built. There was no money. I mean, I had to build the ship. So, the ship that was used for the pyrotechnics was only about two feet square, as I recall. So Dennis and I ended up sitting on a table and taking basically model-kit parts, stripping all the parts off, taking the little frames – the little plastic frames that they come on – and gluing them to the side of this box [...] and then spray-painting it, looking at it and sticking more stuff on, spray-painting it some more until, finally, it looked like the Borg ship. It was a spectacular explosion, and beautifully executed. We got it in the first take." (TNG Season 4 DVD–special feature, "New Life and New Civilizations: The Best of Both Worlds")
As of 2011, the original Borg Cube studio model, virtually unmodified and escaping the 40 Years of Star Trek: The Collection and It's A Wrap! auctions, is still in the possession of Paramount Pictures and has been on tour displays such as Star Trek World Tour, Star Trek: The Exhibition, and Star Trek: The Adventure as late as 2011. 
The First Contact physical studio model
When it came to producing Star Trek: First Contact, the producers deemed the original studio model too crude and not detailed enough to hold up to big screen requirements and had both John Eaves and, briefly, Ricardo F. Delgado submit design variations.
Eaves, the designing process quickly gravitating towards him, started out with experimenting with a tetragonal shape. "The first one I did was very, very smooth; that was when it was still very large. It was this reflective block and it had all these inset passages you could fly through or other things could fly out of. They said, "OK, that's kind of cool. Let's carry that a little bit further, but not so smooth; we need that Borg detail.(...)I knew that Goodson was going to work on the model - they were going to use brass etch, and there's really no way you can draw it - so what I did was just a guideline for the kind of shapes. I try to do that with all the drawings I do; I leave a lot of the spaces open so the modeler can be part of the creative process." Adhering to the producer's wishes Eaves second pass suggested more paneling and large recessed areas. Finding the patterns too regular, Eaves third pass was an effort to break up the regularity. "That was also rectangular, but it's got a lot of really deep valleys and its got a little round escape sphere on the surface. That one they really liked; they said 'Let's go with that.'", Eaves continued.
Upon consideration, however, the producers eventually decided to go along with the established cube design (though the tetragonal shape was later revisited with the Borg probe) and Eaves went on to rework the cube, ""The first one was really overly detailed. That's where I started incorporating 45-degree lines all throughout it. They liked that; it was very intricate, but it was too busy, so they had me go with version two. That was the same breakup; I started putting a heavier panel on top of it and incorporating the escape hatch. That was more the direction they were wanting, so Zimmerman had me do a color pass on it. That one has the hatch on the left-handed side; for the very final pass they had me put the hatch on on the right side and they went back to a little finer detail. It was almost going back in a full circle back to the first sketch. It had a little bit of heavier panel but more of the fine-scale stuff." During this process the size of the cube was in flux ranging from 3,000 feet to 1,500 feet, the size eventually decided upon, which Eaves himself considered too small. He tried to remedy that by downsizing the detail on his design as to create a sense of scale. At first the circular escape hatch was an prominent feature on the cube, "As the model went on, they decided to keep the door hidden, so it wouldn't be seen during the attack and wouldn't be revealed until the very last moment. On all the drawings you can see where the port is; that established where on the cube that hatch is, but, in fact you never saw it except for that one where it opens, so really it could be anywhere." (Star Trek: The Magazine Volume 1, Issue 23, pp. 53-58)
Eaves' final design, a more detailed and compact looking design, resulting in less transparency at the edges, was approved in March 1996 and sent over to the model shop at Industrial Light & Magic. Model makers John Goodson (supervising), Barbara Affonso, Giovanni Donovan, and Jon Foreman constructed the thirty-inch model out of layers of photo-etched brass etch, suggested by Bill George with modeled styrene pieces placed sporadically throughout. The great intricacy of the brass etch gave the model a distinctly more detailed and varying look from the television model, though it was actually smaller. "There were layers and layers of detail, five inches deep, which helped convey the complexity and scale of this ship," Alex Jaeger observed. (Cinefex, issue 69, p. 109) Apart from the brass etch, ample use was made of lowly paper-clips to further embellish the cube's surface with detail. (Star Trek: The Next Generation Sketchbook: The Movies, pp. 216-218) Internally lit by neon lighting, the light pattern was broken up by a patterned eighteen-inch green lightbox to suggest different compartments and light sources within the model. Also built into the model was a five-inch-long motion-controlled circular passageway for the Borg sphere's escape. In post-production, the sphere was composited into the footage of the cube since the sphere model was actually almost as large as the cube model.
Effects Supervisor John Knoll remarked on ILM's approach to showcase the model, "The idea of having this big ship, three miles square, that was nothing but a junky-looking cube, was very different than what had previously been done on a Star Trek film. I wanted it to look bigger and badder, so wherever possible, we were looking up at it. We shot it fairly close with relatively wide lenses, and tried to make it break frame in many shots, as if it's too big too photograph completely. It's hard to do a shot of an office building where you see the whole thing. I also turned the cube 45 degrees so that one edge of it would come toward the camera like the prow of a ship." (American Cinematographer, December 1996, p. 69) Knoll's insistence on extreme close-ups of the model, was the main reason why the studio model had to be as detailed as possible.
For the close-up battle damaged scenes, a sixty-inch side was specifically constructed to showcase battle damage, with especially designed model sections, that could be removed and replaced, with a burn then airbrushed around the "damaged" areas. For the destruction scene of the cube, no less than ten thirty-inch break-away models were blown up, supervised by Geoff Heron to depict the scene, the scene being shot by Martin Rosenberg from underneath with the high-speed camera protected by piece of plywood that covered the matte box. "At the end of each take, the matte box was maybe 4" deep in plastic! We knew when the shot was finished when we couldn't see anything!", Rosenberg recalled. (American Cinematographer, December 1996, p. 70)
Used only once, though some footage taken for the movie was later used in VOY: "Unity", the model, known as Lot 105, part of the 40 Years of Star Trek: The Collection auction, estimated at US$1,000-$1,500, was eventually sold on 5 October 2006 with a winning bid of US$80,000 ($96,000 including buyer's premium), in the process becoming the most undervalued object of the auction.
The CGI studio model
As USS Voyager approached Borg space in season 3 of the series, it was clear they would run into their ships sooner or later as they would in "Unity". Since the VFX of the series was already in the midst of the transition from traditional miniature photography to CGI, the decision was quickly made to make the Borg vessels CGI models.  The model was built at Foundation Imaging by Emile Edwin Smith, who based it on the Next Generation and First Contact physical models, elaborating, "Well, when I built the new cube for Voyager I based everything off image maps and then modeled around them. To make it real simple I had an underlying cube that was mapped with an image. I then took the main image that I had created into modeller and started building on it. Basically it was large areas of chunkiness raised above the inner cube with many of the detailed areas of the map modeled on these areas. I also interconnected the pieces with tubes and added edge pieces to make it look more dimensional and 3d on the edges."  Making its debut in "Unity", this model was used in every subsequent episode the cube made an appearance in, though some stock footage taken from the First Contact model was also used. 
Annika's toy model
On one occasion a Borg cube appeared that did not represent a real in-universe vessel, but rather a model. It was the model Annika Hansen played with in Voyager's season 5 Borg-heavy episode "Dark Frontier". Berated by her father, Magnus Hansen, who admonished his daughter that it was not a toy, young Annika nevertheless used it as such. The model used in the episode actually was a commercially-available toy, the 1994 Borg cube from Playmates Toys, No.6158, which was (loosely) modeled after the television model and which as merchandise featured engines, tractor beam, laser cannon sounds, and a light-up interior.
- Designing Borg Ships - On-line version of the article written by John Eaves that originally appeared in Star Trek: The Magazine Volume 1, Issue 23, March 2001